﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Home.Master" AutoEventWireup="true" CodeBehind="ReportProjectUser.aspx.cs" Inherits="TimeWork.report.ReportProjectUser" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Bredcrumb" runat="server">
    <li><a href="#" class="report">Báo cáo</a></li>>
    <li><a href="#">Báo cáo theo sản phẩm</a></li>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <form id="Form1" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server">
    </asp:ScriptManager>
    <div class="excel print" style="width: 100%;text-align: right;">
        <asp:ImageButton ID="ImageButton1" runat="server" 
            ImageUrl="~/resources/img/icons/excel.png" ToolTip="Xuất ra Excel" 
            onclick="btnExportExcel_Click" />&nbsp;<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/resources/img/icons/xml.png" ToolTip="Xuất ra XML" />&nbsp;<asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/resources/img/icons/print.png" ToolTip="In báo cáo" OnClientClick="window.print()" />
    </div>
    <div class="project report1">
        <table>
            <tr>
                <th class="header" colspan="5">Báo cáo theo sản phẩm</th>
            </tr>
            <tr>
                <td class="tdLabel" style="width: 85px;">Chọn thời gian:</td>
                <td style="width: 240px;">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:DropDownList ID="ddlTime" runat="server" AutoPostBack="True" 
                                onselectedindexchanged="ddlTime_SelectedIndexChanged">
                                <asp:ListItem Value="1">Hôm nay</asp:ListItem>
                                <asp:ListItem Value="2">Hôm qua</asp:ListItem>
                                <asp:ListItem Value="3" Selected="True">Tháng này</asp:ListItem>
                                <asp:ListItem Value="4">Tháng trước</asp:ListItem>
                                <asp:ListItem Value="5">Tháng của năm</asp:ListItem>
                                <asp:ListItem Value="6">Tất cả thời gian</asp:ListItem>
                                <asp:ListItem Value="7">Tùy chọn</asp:ListItem>
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlMonth" runat="server" Visible="False">
                                <asp:ListItem Value="1">Tháng 1</asp:ListItem>
                                <asp:ListItem Value="2">Tháng 2</asp:ListItem>
                                <asp:ListItem Value="3">Tháng 3</asp:ListItem>
                                <asp:ListItem Value="4">Tháng 4</asp:ListItem>
                                <asp:ListItem Value="5">Tháng 5</asp:ListItem>
                                <asp:ListItem Value="6">Tháng 6</asp:ListItem>
                                <asp:ListItem Value="7">Tháng 7</asp:ListItem>
                                <asp:ListItem Value="8">Tháng 8</asp:ListItem>
                                <asp:ListItem Value="9">Tháng 9</asp:ListItem>
                                <asp:ListItem Value="10">Tháng 10</asp:ListItem>
                                <asp:ListItem Value="11">Tháng 11</asp:ListItem>
                                <asp:ListItem Value="12">Tháng 12</asp:ListItem>
                            </asp:DropDownList>
                            <br />
                            <asp:Label ID="lblStart" runat="server" Text="Từ:" Visible="False"></asp:Label>&nbsp;
                            <asp:TextBox ID="txtStartTime" runat="server" Visible="False" Width="75"></asp:TextBox>
                            <asp:Label ID="lblEnd" runat="server" Text="Đến:" Visible="False"></asp:Label>&nbsp;
                            <asp:TextBox ID="txtEndTime" runat="server" Visible="False" Width="75"></asp:TextBox>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
                <td class="tdLabel" style="width: 92px;" valign="top">Chọn sản phẩm:</td>
                <td valign="top" colspan="2">
                    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                        <ContentTemplate>
                            <asp:DropDownList ID="ddlproject" runat="server" AutoPostBack="True" 
                                onselectedindexchanged="ddlproject_SelectedIndexChanged">
                            </asp:DropDownList><br />
                            <asp:DropDownList ID="ddlActivity" runat="server" Width="295px" style="margin-top: 3px;">
                            </asp:DropDownList>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td class="tdLabel">&nbsp;</td>
                <td>
                    <asp:DropDownList ID="ddlUser" runat="server" Visible="false">
                    </asp:DropDownList>
                </td>
                <td class="tdLabel">Đối tác</td>
                <td>
                    <asp:DropDownList ID="ddlClient" runat="server">
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:CheckBox ID="cbClient" runat="server" Text=" Hiện đối tác" Visible="False" />
                </td>
            </tr>
            <tr>
                <td class="tdLabel">Đơn vị:</td>
                <td>
                    <asp:DropDownList ID="ddlResultUnit" runat="server">
                    </asp:DropDownList>
                </td>
                <td class="tdLabel">Loại thời giờ:</td>
                <td>
                    <asp:DropDownList ID="ddlTypeTime" runat="server">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="5" align="right">
                    <asp:Button ID="btnGenerate" runat="server" Text="Tạo báo cáo" 
                        CssClass="mybutton" onclick="btnGenerate_Click" />
                </td>
            </tr>
        </table>

        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnGenerate" EventName="Click" />
            </Triggers>
            <ContentTemplate>
                <center style=" padding: 10px 0px; "><asp:Label ID="lblData" runat="server" Font-Bold="True" Font-Italic="True" 
                        ForeColor="Maroon"></asp:Label></center>
                <asp:GridView ID="gvReport" runat="server" 
                    onrowdatabound="gvReport_RowDataBound" AutoGenerateColumns="false" 
                    onrowcreated="gvReport_RowCreated">
                    <Columns>
                        <asp:TemplateField HeaderText="Tên sản phẩm" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblProject" Text='<%# Bind("ProjectName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tên công việc" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblActivity" Text='<%# Bind("ActivityName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Số giờ" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblActivity" Text='<%# Bind("Hour") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Số phút" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblActivity" Text='<%# Bind("Minute") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
                <div class="loading">
                    Đang xử lý <img src="../resources/img/icons/loading.gif" style="width: 31px; height: 31px" alt="Loading" />
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
    </div>
    </form>
</asp:Content>
